import pika

connection = pika.BlockingConnection(pika.ConnectionParameters("127.0.0.1"))
channel = connection.channel()

channel.queue_declare(queue="Hi",durable=True) #队列名持久化
channel.basic_publish(exchange='',
                      routing_key='Hi',
                      properties=pika.BasicProperties(delivery_mode=2,), # 队列持久化
                      body='Hi man'
                      )
connection.close()